package spacewar2.shadows;

import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.geom.Ellipse2D;

import spacewar2.objects.Bullet;
import spacewar2.utilities.Position;

public class BulletShadow extends Shadow {
	Bullet bullet;
	Color bullet_color = new Color(200, 200, 200);
	
	public BulletShadow(Bullet bullet) {
        super((int)(bullet.getRadius() * 2), (int)(bullet.getRadius()  * 2));

        this.bullet = bullet;
	}

	/**
	 * Return the position of the bullet
	 */
	public Position getActualLocation() {
		return bullet.getPosition();
	}

	@Override
	public void draw(Graphics2D graphics) {
        float radius = bullet.getRadius();
        float diameter = radius * 2;

        graphics.setColor(bullet_color);
        graphics.fill(new Ellipse2D.Float((float)drawLocation.getX() - radius,
                (float)drawLocation.getY() - radius, diameter, diameter));

	}

	@Override
	public boolean isDrawable() {
		return bullet.isAlive();
	}

}
